#include "StdAfx.h"

FontBatch::FontBatch() {
	D3DXCreateSprite(sD3D, &mSprite);
}

void FontBatch::beginBatch() {
	mSprite->Begin(0);
}

void FontBatch::endBatch() {
	mSprite->End();
}

void FontBatch::drawTextA(CFont& font, ui32 x, ui32 y, ui32 w, ui32 h, std::string szText, DWORD dwColor /* = 0xFFFFFFFF */, ui32 format /* = 0 */) {
	font.BatchDrawTextA(x, y, w, h, szText, dwColor, format, mSprite);
}

void FontBatch::drawTextW(CFont& font, ui32 x, ui32 y, ui32 w, ui32 h, std::wstring szText, DWORD dwColor /* = 0xFFFFFFFF */, ui32 format /* = 0 */) {
	font.BatchDrawTextW(x, y, w, h, szText, dwColor, format, mSprite);
}

void FontBatch::onDeviceLost() {
	mSprite->OnLostDevice();
}

void FontBatch::onDeviceReset() {
	mSprite->OnResetDevice();
}